package com.etone.Class;

import java.util.ArrayList;
import java.util.List;

public class ClassUtils {

	public static <T> List<T> findClassByInterface(Class<T> clazz){
		
		List<T> list = new ArrayList<T>();
		
		if(clazz.isInterface()){
			Class<?>[] temp = clazz.getClasses();
			for(Class<?> obj : temp){
				if(!obj.isInterface()){
					System.out.println(obj.getName());
				} else
					findClassByInterface(obj);
			}
		}
		
		return list;
	}
	
	public static void main(String[] args) {
		ClassUtils.findClassByInterface(String.class);
	}
}
